﻿using WeDonekRpc.HttpApiGateway;
using WeDonekRpc.Helper.Validate;
using RpcStore.RemoteModel.CurConfig.Model;
using Store.Gatewary.Modular.Interface;

namespace Store.Gatewary.Modular.Api
{
    /// <summary>
    /// 服务节点当前配置信息
    /// </summary>
    internal class ServerCurConfigApi : ApiController
    {
        private readonly IServerCurConfigService _Service;

        public ServerCurConfigApi (IServerCurConfigService service)
        {
            this._Service = service;
        }
        /// <summary>
        /// 获取服务节点的配置信息
        /// </summary>
        /// <param name="serverId"></param>
        /// <returns></returns>
        public CurConfigModel Get ([NumValidate("rpc.store.server.id.null", 1)] long serverId)
        {
            return this._Service.Get(serverId);
        }
    }
}
